In Swift's switch, the case is followed by the use of Fallthrough, which is the same as the usage without break after OC case!The use of Fallthrough should be noted:1. When Fallthrough is added, the following case or default statement will be run
This is a creation in
Article, where the information may have evolved or changed.
This note is based on the Gocourse document in the Doc folder in the Go Language installation directory, which is included in the reference Format section of this
This is a creation in
Article, where the information may have evolved or changed.
Depending on the incoming condition, the SELECT statement executes a different statement. The following example prints a different content based on the input integer
This is a creation in
Article, where the information may have evolved or changed.
Before starting a new chapter, take a look at the part of the previous article, first of all, let's see this code:
Package main Import ( "FMT" ) func
Before starting a new chapter, let's review the previous article. First, let's look at this generation:
Package main import ("FMT") func main () {var X, Y Int = 1, 2 {var x Int = 2 {var x Int = 3 FMT. println (x, y) // first, output 3, 2. If I
This is a creation in
Article, where the information may have evolved or changed.
7. Toad Notes Go language--if,switch,defer
If
The IF statements do not appear to be the same as in C or Java, except that they do not have ' () ' (even forcing them to
This is a creation in
Article, where the information may have evolved or changed.
14. Toad Notes Go language--Detail summary One
Slice and arrays differ in declaration: When declaring an array, the length of the array is indicated in square brackets
The example in this article describes the switch usage in the Go language. Share to everyone for your reference. The specific analysis is as follows:
Here you may have guessed the possible form of the switch.The case experience terminates
This is a creation in
Article, where the information may have evolved or changed.
33. Toad Notes Go language--switch keywords
The switch of Go is very flexible. The expression does not have to be a constant or an integer, and the process is
Control pass-through statements (controlled Transfer statements)The control transfer statement changes the order in which you run the code, through which you can implement the code jump. Swift has four kinds of control transfer
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.